<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
	<head>
		<%@ include file="/WEB-INF/jsp/inc/taglibs.jsp"%>
		<%@ include file="/WEB-INF/jsp/inc/meta.jsp"%>
		<script type="text/javascript">
	function checkAll(val) {
		//alert(val);
		if (val)
			$('input[name=ids]').each(function() {
				$(this).attr('checked', true);
			})
		else
			$('input[name=ids]').each(function() {
				$(this).attr('checked', false);
			})
	}
	function gotopage() {
		var page = $('#topage').val();
		var url = '${approot}/admin/excerpt/list_for_person/page/' + page;
		// alert(url);
		window.location.href = url;
	}
	//清空恢复表单原始数据
	function formreset() {
		$("input[type=text]").val("");
		$("#type").val("0");
	}

	

	
</script>
	</head>
	
	<body style="background: #E8F5FE; padding: 15px 18px;" class="scroll_r">
 <div id="header_d">
 <div id="header_d_t">
  <h1>SH-001单点信息获取软件</h1>
  <div id="header_d_r">
   
    <span class="header_k"></span>
    <span class="header_k"></span>
    <span class="header_k"></span>
	<span class="header_k"></span>
    <span class="header_k" style="margin-right:80px;"></span>
   
   <div style="clear:left; text-align:right;">
   <span class="header_t_m"><a href="" class="header_t_a1"></a></span>
   <span class="header_t_m"><a href="${approot}/main/exit" class="header_t_a2" target="mainFrame"></a></span>
   <span class="header_t_m"><a href="#" class="header_t_a3"></a></span>
  </div> 
  </div>
   
 </div>
 <div id="header_ri_b">
 
  <div class="right" style="padding-right:35px; width:70%; text-align:right;margin-top:-4px;">
   <span>今天是：<script type="text/javascript" src="<c:url value="/resource/js/date.js"/>"></script></span>
  </div>
 </div>
</div><br/>
		<form method="post" action="${approot}/admin/excerpt/list_for_person/form/0"
			id="excerptBean">

			<table border="0" cellpadding="0" cellspacing="1" width="92%"
				align="center" id="add_tab">

				<tr>
				<th>
						用户编号：
					</th>
					<td>
						<input type="text" readonly="readonly"
							value="${excerptBean.number}" />
					</td>
					
					<th width="200px">
						抄表时间：<input type="hidden" id="number" name="number"
							value="${excerptBean.number}" />
					</th>
					<td width="200px">
						<input type="text" id="startTime" name="startTime"
							value="${excerptBean.strStartDate}" class="Wdate"
							onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" />
					</td>
					<th>
						至
					</th>
					<td>
						<input type="text" id="endTime" name="endTime"
							value="${excerptBean.strEndDate}" class="Wdate"
							onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" />
					</td>
				</tr>
				<tr>
					<td colspan="8" style="text-align: center">
						<input type="submit" class="but" value="开始查询">
						<input type="button" class="but" onclick="formreset()" value="重置条件">

					</td>

				</tr>

			</table>
		</form>


		<c:choose>
			<c:when test="${fn:length(page.items)<1}">
				<div align="center">
					<font color='red'>对不起,暂时没有找到符合条件的数据!</font>
				</div>
			</c:when>
			<c:otherwise>
				<table border="0" cellpadding="" cellspacing="1" align="center"
					width="92%" id="web_tab" >
					
					<tr>
						
						<th>
							客户编号
						</th>
						<th>
							姓名
						</th>
						<th>
							地址
						</th>
						<th>
							用气类型
						</th>
						<th>
							读数
						</th>
						<th>
							气量
						</th>
						<th>
							气费
						</th>

						<th>
							用户账号
						</th>
						<th>
							电话
						</th>
						<th>
							状态
						</th>
						<th>
							抄表日期
						</th>
						
					</tr>
					<c:forEach var="excerpt" items="${page.items}">
						<tr>
							
							<td>
								${excerpt.personNumber}
							</td>
							<td>
								${excerpt.personName}
							</td>
							<td>
								${excerpt.address}
							</td>
							<td>
								<c:if test="${excerpt.gasType==0}">天然气</c:if>
								<c:if test="${excerpt.gasType==1}">液化气</c:if>
								<c:if test="${excerpt.gasType==2}">商业气</c:if>
							</td>
							<td>
								${excerpt.readAmount}
							</td>
							<td>
								${excerpt.gasAmount}
							</td>
							<td>
								${excerpt.gasMoney}
							</td>
							<td>
								${excerpt.personCard}
							</td>
							<td>
								${excerpt.personPhone}
							</td>
							<td>
							<c:if test="${excerpt.payStatus == 0}"><font color="#ff0000">未缴费</font></c:if>
							<c:if test="${excerpt.payStatus == 1}">已缴费</c:if>
							</td>
							<td>
								<fmt:formatDate value="${excerpt.excerptTime}"
									pattern="yyyy-MM-dd HH:mm:ss" />
							</td>
							

						</tr>
					</c:forEach>
				</table>

				<table border="0" cellpadding="0" cellspacing="1" width="92%"
					align="center">
					<tr>
						<td align="left">
							共有
							<font color='red'>${page.totalCount}</font> 条记录，当前第
							<font color='red'>${page.currentPage}</font>页，共
							<font color='red'>${page.pageCount}</font>页
						</td>
						<td align="right">
							转到
							<select name="topage" id="topage" onchange="gotopage();">
								<c:forEach var="ind" items="${page.pages}">
									<option value="${(ind-1)*page.pageSize}"
										<c:if test="${ind==page.currentPage}">selected="selected"</c:if>>
										${ind}
									</option>
								</c:forEach>
							</select>

							<button class="but"
								onclick="window.location.href='${approot}/admin/excerpt/list_for_person/page/${page.firstIndex}'">
								首页
							</button>
							<button class="but"
								onclick="window.location.href='${approot}/admin/excerpt/list_for_person/page/${page.previousIndex}'">
								上一页
							</button>
							<c:forEach items="${page.showpages}" var="ind">
								<c:if test="${ind!=0}">
									<a
										href="${approot}/admin/excerpt/list_for_person/page/${(ind-1)*page.pageSize}">${ind}</a>
								</c:if>
							</c:forEach>
							<button class="but"
								onclick="window.location.href='${approot}/admin/excerpt/list_for_person/page/${page.nextIndex}'">
								下一页
							</button>
							<button class="but"
								onclick="window.location.href='${approot}/admin/excerpt/list_for_person/page/${page.lastIndex}'">
								末页
							</button>

						</td>
					</tr>
				</table>
			</c:otherwise>
		</c:choose><br/><br/>
		<div id="footer_b"> Copyright &copy;2010 All Rights Reserved</div>
	</body>
</html>
